﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.Data;
using IToursDataService.Models;

namespace IToursDataService
{
    // 注意: 使用“重构”菜单上的“重命名”命令，可以同时更改代码和配置文件中的接口名“ITeamGroupCtrl”。
    [ServiceContract]
    public interface ITeamGroupCtrl
    {
        #region 团有关数据获取

        /// <summary>
        /// 根据团号获取组团s人A
        /// </summary>
        /// <param name="tourgroupid"></param>
        /// <returns></returns>
        [OperationContract]
        string GetTeamGroupOwnerAByTourgroupID(string tourgroupid);

        /// <summary>
        /// 根据团号获取团名
        /// </summary>
        /// <returns></returns>
         [OperationContract]
        string GetTeamGroupNameById(string tourgroupid);

        /// <summary>
        /// 根据团号获取部门Email
        /// </summary>
        /// <returns></returns>
          [OperationContract]
       string GetDepartmentEmailById(string tourgroupid);


        [OperationContract]
         TeamStateEnum GetTourGroupState(string tourGroupID);

        /// <summary>
        /// 获取指定团的房间备注信息
        /// </summary>
        /// <param name="tourGroupID"></param>
        /// <returns></returns>
        [OperationContract]
         string GetTeamGroupRoomRemark(string tourGroupID);

        /// <summary>
        /// 根据指定计划号获取团的国家代码
        /// </summary>
        /// <param name="tourgroupId"></param>
        /// <returns></returns>
         [OperationContract]
        string GetCountryNameForTeamGroup(string tourgroupId);

        /// <summary>
        /// 获取系统中所有团的团号/计划号
        /// </summary>
        /// <returns></returns>
         [OperationContract(Name = "GetAllIDForTeamGroupWithoutID")]
         DataSet GetAllIDForTeamGroup();

        /// <summary>
        ///  根据给定的客户名称检索客户所在团信息
        /// </summary>
        /// <param name="guestName"></param>
        /// <returns></returns>
         [OperationContract(Name = "GetTeamGroupDataB")]
         DataTable GetTeamGroupData(string guestName, int providerLoginID);
 

        /// <summary>
        /// 根据条件获取团数据
        /// </summary>
        /// <param name="start"></param>
        /// <param name="end"></param>
        /// <param name="teamstate"></param>
        /// <param name="username">我的团（当前登录用户）</param>
        /// <param name="departmentId"></param>
        /// <returns></returns>
         [OperationContract(Name = "GetTeamGroupDataC")]
         DataTable GetTeamGroupData(DateTime start, DateTime end, string loginProviderId, string ownerAB);

        /// <summary>
        /// 根据条件获取团数据
        /// </summary>
        /// <param name="hasGuide">false,全部，true,无导游</param>
        /// <param name="tourgroupId"></param>
        /// <param name="dateTime"></param>
        /// <returns></returns>
         [OperationContract(Name = "GetTeamGroupDataD")]
         DataTable GetTeamGroupData(string tourGroupId, string dateMonth, string loginProviderId);//,string endDate)


        [OperationContract]
         DataTable GetTeamGroupRowData(string tourGroupID);

        [OperationContract]
        DataTable GetTeamGroupRowDataforHotelorder(string tourGroupID);

        /// <summary>
        ///  获取指定团的备注信息
        /// </summary>
        /// <param name="tourGroupID"></param>
        /// <returns></returns>
         [OperationContract]
        string GetTourGroupScheduleRemark(string tourGroupID);

        /// <summary>
        ///  获取指定团的本地备注信息
        /// </summary>
        /// <param name="tourGroupID"></param>
        /// <returns></returns>
         [OperationContract]
        string GetTourGroupScheduleLocalRemark(string tourGroupID);

        #endregion

        #region 团有关数据增、删、改

        /// <summary>
        /// 更新团行数据的计调操作状态,0、试图打开但检测到没有本地计划信息需拷贝时，置为0； 1、以首次打开为依据，将大计划的本地行程信息拷贝过来，状态置为1；2、手动方式，在本地行程计划中添加一个check框，来确定是否团已经处理过了，true=2，false=1
        /// </summary>
        /// <param name="tourGroupId"></param>
        /// <param name="localTourgroupRowState"></param>
        /// <returns></returns>
         [OperationContract]
        int UpdateTourGroupLocalTourgroupRowState(string tourGroupId, int localTourgroupRowState);

        /// <summary>
        /// 更新团的‘宾馆备注信息’字段
        /// </summary>
        /// <param name="tourGroupId"></param>
        /// <param name="state"></param>
        /// <returns></returns>
         [OperationContract]
        int UpdateTourGroupRoomRemark(string tourGroupId, string roomRemark);
 
        /// <summary>
        /// 更新团的‘本地行程计划的备注’字段
        /// </summary>
        /// <param name="tourGroupId"></param>
        /// <param name="state"></param>
        /// <returns></returns>
          [OperationContract]
       int UpdateTourGroupLocalRemark(string tourGroupId, string localRemark);
 
        /// <summary>
        /// 根据团Id更新‘预算成本、预算价格’
        /// </summary>
        /// <param name="tourGroupId"></param>
        /// <param name="budgeTotalCost"></param>
        /// <param name="budgeTotalPrice"></param>
        /// <returns></returns>
          [OperationContract]
          int UpdateTourGroupSale(string tourGroupId, decimal saleTotalCost, decimal saleTotalPrice, string currency, decimal exchangeRate, decimal currencyAmount);

         /// <summary>
        /// 根据团Id更新‘审核成本’
        /// </summary>
        /// <param name="tourGroupId"></param>
        /// <returns></returns>
        [OperationContract]
         int UpdateTourGroupBudgeCost(string tourGroupId);

        #endregion

        #region 行程计划数据的获取
        [OperationContract]
         DataSet GetTourGroupSchedule(string tourGroupID);

        #endregion

        #region 行程计划打印——团、计划、旅行社信息获取

        [OperationContract]
         DataTable GetTourGroupScheduleForSchedulePrint(string tourGroupID);


        [OperationContract]
         DataTable GetTourGroupScheduleForChangeNotifyPrint(string tourGroupID);


        [OperationContract]
         DataTable GetTeamGroupDataForSchedulePrint(string tourGroupID);

        /// <summary>
        /// 按指定ID顺序返回供应商信息，用union all语句完成
        /// </summary>
        /// <param name="providerIds"></param>
        /// <returns></returns>
        [OperationContract]
         DataTable GetTravelOrHotelInfoForPrint(string[] providerIds);


        [OperationContract]
         DataTable GetScheduleTravelsIDForPrint(string tourGroupID);

        [OperationContract]
         DataTable GetScheduleHotelIDForPrint(string tourGroupID);

        #endregion

        #region 获取客人列表

        [OperationContract]
         DataTable GetGuestListData(string tourGroupId);

        #endregion

        #region 行程计划有关数据增、删、改

        /// <summary>
        /// 根据行程计划号，更新行程计划数据
        /// </summary>
        /// <param name="scheduleData"></param>
        /// <returns></returns>
        [OperationContract]
        int UpdateTourGroupSchedule(TourGroupScheduleEntity scheduleData);


        /// <summary>
        /// 删除指定计划号数据
        /// </summary>
        /// <param name="tourGroupScheduleID"></param>
        /// <returns></returns>
        [OperationContract]
         int DeleteTourGroupSchedule(int tourGroupScheduleID);



        #endregion


    }
}
